export function getCookie(name: string) {
    // 分割cookie字符串为键值对数组
    const cookies = document.cookie.split('; ');
    for (let i = 0; i < cookies.length; i++) {
        // 获取键值对
        const cookiePair = cookies[i].split('=');
        // 解码并检查是否是我们要找的cookie
        const decodedCookie = decodeURIComponent(cookiePair[0]);
        if (decodedCookie === name) {
            // 返回解码后的值
            return decodeURIComponent(cookiePair[1]);
        }
    }
    // 如果没有找到匹配的cookie，则返回null
    return null;
}
export function getToken(){
    return getCookie('token');
}
